package com.bw.zhuangao5___day002.Fragment.Movies.One.Day3;

import android.view.View;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bw.zhuangao5___day002.R;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * 类名： MoviesDay3BaseAdpter
 * 作者： Android工程师杨晨
 * 日期： 2021/10/3 15:50
 * DAO：  ZhuanGao5___Day002
 */
public class MoviesDay3BaseAdpter extends BaseQuickAdapter<JavaBeanDay3, BaseViewHolder> {


    public MoviesDay3BaseAdpter( @Nullable List<JavaBeanDay3> data) {
        super(R.layout.moviesday3layout1, data);
        addChildClickViewIds(R.id.Tianzi_Checkbox);
        addChildClickViewIds(R.id.Tianzi_Button1);
        addChildClickViewIds(R.id.Tianzi_Button2);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, JavaBeanDay3 javaBeanDay3) {

        CheckBox checkBox = baseViewHolder.getView(R.id.Tianzi_Checkbox);
        checkBox.setChecked(javaBeanDay3.isIschen());


        TextView textView = baseViewHolder.getView(R.id.Tianzi_Num);
        textView.setText(""+javaBeanDay3.getNoosumer());


        Glide.with(getContext()).load(javaBeanDay3.getPic()).into((ImageView) baseViewHolder.getView(R.id.Tianzi_ImageView));
        baseViewHolder.setText(R.id.Tianzi_TextView1,javaBeanDay3.getName());
        baseViewHolder.setText(R.id.Tianzi_TextView2,javaBeanDay3.getCialiao());
        baseViewHolder.setText(R.id.Tianzi_TextView3,javaBeanDay3.getStringname());




    }
}
